//
// Created by Admin on 2021/9/20.
//

#include "entry.h"

void search_student_byNo(pStudent students, int student_count,int subject_count, int number){

    for(int i=0;i<student_count;i++){
        if(students[i].rank==0){
            calc_student_rank_by_Score(students, student_count,subject_count);
        }
    }

    for(int i=0;i<student_count;i++){
        if(students[i].number == number){
            printf("按学号%d找到学生%s,名次：%d",number,students[i].name,students[i].rank);
            printf("各科成绩如下：\n");
            for(int j=0;j<subject_count;j++){
                printf("\t学科%d,成绩%d\n",j,students[i].subjects[j].score);
            }
            break;
        }
    }
}